type api = {
  name: string
  type: string
  url: string
  method: string
  des: string
  params: param[]
  share: 'public' | 'limit'
  publishTime: string
}

type param = {
  name: string
  type: string
  des: string
  required: boolean
  default: string
  example: string
}

export const apiData: api[] = [
  {
    name: '数公基实体统一识别代码编码接口',
    type: 'api',
    url: 'encode/tysbdm',
    method: 'get',
    params: [
      {
        name: 'regionCode',
        type: 'string',
        des: '行政区划码',
        required: true,
        default: '',
        example: '421182'
      },
      {
        name: 'typeCode',
        type: 'string',
        des: '实体分类码',
        required: true,
        default: '',
        example: '301211'
      }
    ],
    des: '武穴市编码赋码平台提供，用于申请数公基实体统一识别代码',
    share: 'limit',
    publishTime: '2024-06-24'
  },
  {
    name: '数公基实体北斗二维网格码编码接口',
    type: 'api',
    url: 'encode/beidou2d',
    method: 'get',
    params: [
      {
        name: 'longitude',
        type: 'string',
        des: '经度',
        required: true,
        default: '',
        example: '114.26'
      },
      {
        name: 'latitude',
        type: 'string',
        des: '纬度',
        required: true,
        default: '',
        example: '30.21'
      }
    ],
    des: '武穴市编码赋码平台提供，用于获取根据数公基实体对象的中心点位置生成的二维北斗网格码',
    share: 'limit',
    publishTime: '2024-07-01'
  },
  {
    name: '数公基实体北斗三维网格码编码接口',
    type: 'api',
    url: 'encode/beidou3d',
    method: 'get',
    params: [
      {
        name: 'longitude',
        type: 'string',
        des: '经度',
        required: true,
        default: '',
        example: '114.26'
      },
      {
        name: 'latitude',
        type: 'string',
        des: '纬度',
        required: true,
        default: '',
        example: '30.21'
      },
      {
        name: 'altitude',
        type: 'string',
        des: '高度',
        required: true,
        default: '',
        example: '893.32'
      }
    ],
    des: '武穴市编码赋码平台提供，用于获取根据数公基实体对象的中心点位置生成的三维北斗网格码',
    share: 'limit',
    publishTime: '2024-07-02'
  }
]

export const codeData = [
  {
    name: '数公基实体统一识别代码编码接口',
    code: ` 
    // OkHttp
    OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
   .url("http://58.48.30.30:17090/api/encode/beidou3d?longitude=114.26&latitude=30.21&altitude=893.32")
   .method("GET", body)
   .addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
   .addHeader("Accept", "*/*")
   .addHeader("Host", "58.48.30.30:17090")
   .addHeader("Connection", "keep-alive")
   .build();
Response response = client.newCall(request).execute();`,
    res: {
      code: 200,
      message: 'Success',
      data: 'N050H000403002098720074074073074'
    }
  },
  {
    name: '数公基实体北斗二维网格码编码接口',
    code: ` 
    // OkHttp
    OkHttpClient client = new OkHttpClient().newBuilder()
       .build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "");
    Request request = new Request.Builder()
       .url("http://58.48.30.30:17090/api/encode/beidou2d?longitude=114.26&latitude=30.21")
       .method("GET", body)
       .addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
       .addHeader("Accept", "*/*")
       .addHeader("Host", "58.48.30.30:17090")
       .addHeader("Connection", "keep-alive")
       .build();
    Response response = client.newCall(request).execute();`,
    res: {
      code: 200,
      message: 'Success',
      data: 'N50H043029820707'
    }
  },
  {
    name: '数公基实体北斗三维网格码编码接口',
    code: ` 
    // OkHttp
    OkHttpClient client = new OkHttpClient().newBuilder()
       .build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "");
    Request request = new Request.Builder()
       .url("http://58.48.30.30:17090/api/encode/beidou2d?longitude=114.26&latitude=30.21")
       .method("GET", body)
       .addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
       .addHeader("Accept", "*/*")
       .addHeader("Host", "58.48.30.30:17090")
       .addHeader("Connection", "keep-alive")
       .build();
    Response response = client.newCall(request).execute();`,
    res: {
      code: 200,
      message: 'Success',
      data: 'N50H043029820707'
    }
  }
]
